<?php
include('include/config.inc.php');
$abc  = array();
$targateDate = $_REQUEST['targetedDateYearAj']."-".$_REQUEST['targetedDateMonthAj']."-".$_REQUEST['targetedDateDayAj'];
///// Select technician : Start
$selectTechnician = "SELECT technicianId, firstName, lastName, 1 AS selected
                       FROM technician
                      WHERE technicianId IN (SELECT technicianId
                                               FROM techallocation
                                              WHERE date = '".$targateDate."')
                        AND userType = 'None' 
                     UNION
                     SELECT technicianId, firstName, lastName, 0 AS selected
                       FROM technician
                      WHERE technicianId NOT IN (SELECT technicianId
                                               FROM techallocation
                                              WHERE date = '".$targateDate."')
                        AND userType = 'None' ";
$selectTechnicianResult = mysql_query($selectTechnician);
$count = 0;
while($technicianRow = mysql_fetch_array($selectTechnicianResult))
{
  if($technicianRow['selected'] == 1)
  {
    $abc[$count] =  "<option value='".$technicianRow['technicianId']."' style='color: red;'>".$technicianRow['firstName']." ".$technicianRow['lastName']."</option>";
  }
  else
  {
    $abc[$count]  =  "<option value='".$technicianRow['technicianId']."' style='color: blue;'>".$technicianRow['firstName']." ".$technicianRow['lastName']."</option>";
  }
  $count++;
}

$smarty->assign("abc",$abc);
$smarty->display("techAlloEditTechAj.tpl");
?>